const mysql = require('mysql')

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '584521',
  database : 'big_screen'
});

connection.connect();

  exports.query=($sql,$params)=>{
    return new Promise((resovle,reject)=>{
        connection.query($sql,$params,(error, results)=> {
            if (error) {
                reject(error)
            } else {
                resovle(results)
            }
          });
    })
  }